//
//  RoleParser.m
//  Login
//
//  Created by Fanty on 13-12-19.
//  Copyright (c) 2013年 Fanty. All rights reserved.
//

#import "RoleParser.h"

#import <MainModuleSDK/RolesModel.h>

@implementation RoleParser

-(void)onParser:(id)jsonMap{
    if([jsonMap isKindOfClass:[NSDictionary class]]){
        NSDictionary* dict=jsonMap;
        RolesModel* roleModel=[[RolesModel alloc] init];
        roleModel.roleName=[dict objectForKey:@"rolesTag"];
        
        NSArray* jsonArray=[dict objectForKey:@"modules"];
        NSMutableArray* array=[[NSMutableArray alloc] initWithCapacity:2];
        roleModel.identifierArray=array;
        for(NSDictionary* dict in jsonArray){
            [array addObject:[dict objectForKey:@"identifier"]];
        }
        result=roleModel;
    }
}


@end

